package com.boy.mapper;

import com.boy.entity.Code;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author whd
 * @since 2024-06-06
 */
public interface CodeMapper extends BaseMapper<Code> {


    @Delete("DELETE FROM t_code WHERE email = #{email}")
    int deleteByEmail(String email);
@Select("select *\n" +
        "        from t_code where UNIX_TIMESTAMP(created) >= UNIX_TIMESTAMP(NOW()) - (5 * 60)  and email=#{email}")
    Code selectByEmail(String email);
}
